Move private GdkSurface Wayland API into its own header
authorEmmanuele Bassi <ebassi@gnome.org>
Mon, 12 Oct 2020 15:40:19 +0000 (16:40 +0100)
committerEmmanuele Bassi <ebassi@gnome.org>
Mon, 12 Oct 2020 15:40:19 +0000 (16:40 +0100)
This allows us to hide private API from installed headers,
documentation, and introspection.

gdk/wayland/gdksurface-wayland.c
gdk/wayland/gdksurface-wayland.h [new file with mode: 0644]
gdk/wayland/gdkwaylandsurface.h
gtk/gtkapplication-wayland.c
gtk/gtkwindow.c

index 0d8fe2fe7480a89a47cf96aab0f9f6abc1c22e2c..bb78d49730995def3edaf226cf6fb1e28601fe62 100644 (file)
 
 #include "config.h"
 
-#include <netinet/in.h>
-#include <unistd.h>
-
-#include "gdk.h"
-#include "gdkwayland.h"
-#include "gdkwaylandsurface.h"
+#include "gdksurface-wayland.h"
 
 #include "gdkdeviceprivate.h"
 #include "gdkdisplay-wayland.h"
@@ -45,6 +40,9 @@
 #include <string.h>
 #include <errno.h>
 
+#include <netinet/in.h>
+#include <unistd.h>
+
 #define SURFACE_IS_TOPLEVEL(surface)  TRUE
 
 #define MAX_WL_BUFFER_SIZE (4083) /* 4096 minus header, string argument length and NUL byte */
diff --git a/gdk/wayland/gdksurface-wayland.h b/gdk/wayland/gdksurface-wayland.h
new file mode 100644 (file)
index 0000000..1ca3877
--- /dev/null
@@ -0,0 +1,40 @@
+/* gdksurface-wayland.h: Private header for GdkWaylandSurface
+ *
+ * Copyright 2020  GNOME Foundation
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, see <http://www.gnu.org/licenses/>.
+ */
+
+#pragma once
+
+#include "gdkwaylandsurface.h"
+
+G_BEGIN_DECLS
+
+void                     gdk_wayland_toplevel_set_dbus_properties_libgtk_only (GdkToplevel *toplevel,
+                                                                               const char  *application_id,
+                                                                               const char  *app_menu_path,
+                                                                               const char  *menubar_path,
+                                                                               const char  *window_object_path,
+                                                                               const char  *application_object_path,
+                                                                               const char  *unique_bus_name);
+
+void                     gdk_wayland_toplevel_announce_csd       (GdkToplevel *toplevel);
+
+gboolean                 gdk_wayland_toplevel_inhibit_idle       (GdkToplevel *toplevel);
+void                     gdk_wayland_toplevel_uninhibit_idle     (GdkToplevel *toplevel);
+
+G_END_DECLS
index 7fd45c519d2d748e1ac691e2c3f01e1c5e59b119..851a4d5607fea1cdfde191a7fe7b5c351f8f5d1f 100644 (file)
@@ -62,15 +62,6 @@ GType                    gdk_wayland_popup_get_type               (void);
 GDK_AVAILABLE_IN_ALL
 struct wl_surface       *gdk_wayland_surface_get_wl_surface       (GdkSurface *surface);
 
-GDK_AVAILABLE_IN_ALL
-void                     gdk_wayland_toplevel_set_dbus_properties_libgtk_only (GdkToplevel *toplevel,
-                                                                               const char  *application_id,
-                                                                               const char  *app_menu_path,
-                                                                               const char  *menubar_path,
-                                                                               const char  *window_object_path,
-                                                                               const char  *application_object_path,
-                                                                               const char  *unique_bus_name);
-
 typedef void (*GdkWaylandToplevelExported) (GdkToplevel *toplevel,
                                             const char  *handle,
                                             gpointer     user_data);
@@ -92,11 +83,6 @@ GDK_AVAILABLE_IN_ALL
 void                     gdk_wayland_toplevel_set_application_id (GdkToplevel *toplevel,
                                                                   const char  *application_id);
 
-void                     gdk_wayland_toplevel_announce_csd       (GdkToplevel *toplevel);
-
-gboolean                 gdk_wayland_toplevel_inhibit_idle       (GdkToplevel *toplevel);
-void                     gdk_wayland_toplevel_uninhibit_idle     (GdkToplevel *toplevel);
-
 G_END_DECLS
 
 #endif /* __GDK_WAYLAND_SURFACE_H__ */
index 5b175a8ba2ce0a2ee6260997e1282ae5800e0e2b..a892f4be4ba3642b32dcec10b8592e5664590d30 100644 (file)
@@ -26,6 +26,7 @@
 
 #include <gdk/wayland/gdkwayland.h>
 #include <gdk/wayland/gdkdisplay-wayland.h>
+#include <gdk/wayland/gdksurface-wayland.h>
 #include <gdk/wayland/idle-inhibit-unstable-v1-client-protocol.h>
 
 typedef struct
index a6f7f37912db94b191d9c53225a0eeeecd143d9c..1edcd5760b91d891a26917bdf1b3c8fd83a6139a 100644 (file)
@@ -88,6 +88,7 @@
 
 #ifdef GDK_WINDOWING_WAYLAND
 #include "wayland/gdkwayland.h"
+#include "wayland/gdksurface-wayland.h"
 #endif
 
 #ifdef GDK_WINDOWING_BROADWAY